<template>
	<view class="in_list">
		<div class="in_list_class" v-for="(ite,index) in data">
			<div class="list_left">
				<div v-for="(item,index) in ite.tal" @click="inbus_dtl(ite)">
					<div v-if="ite[item.code] " class="list_left_text" 
						v-show="
						item.code == 'title'? true : false ||
						item.code == 'crmName'? true : false ||
						item.code == 'type'? true : false ||
						item.code == 'goingStatus'? true : false 
						">
						<view >
							<text>{{item.name}}:</text><text class="list_tow">{{ite[item.code]}}</text>
						</view>
					</div>
				</div>
			</div>
		</div>
			<popus ref="inbu">
				<div :style="alertWidth">
					<inbuse @close="close" :runData='runData' :setUrl="seturl" :crmType="crm_type"></inbuse>
				</div>
			</popus>
		
	</view>
</template>
<script>
import {list,pages} from '@/common/api/job/jobapi.js'	
import popus from '@/uni_modules/uni-popup/components/uni-popup/uni-popup'
import inbuse from '@/pages/common/index/subpage/inbusiness/inbuse'
export default {
	components:{
		inbuse,
		popus
	},
	props:{
		rundataSorce: {
			default: ''
		},
		rmtype: {
			default: ''
		},
		user_id: {
			default: ''
		},
		textname: {
			default:''
		},
		classid: {
			default: ''
		},
		seturl: {
			default: ''
		}
	},
	data(){
		return {
			dataSorce:'',
			runData: '',
			data: '',
			alertWidth:'',
			crm_type: '',
		}
	},
	mounted() {
		this.data = this.rundataSorce;
		let _this = this;
		uni.getSystemInfo({
		    success: function (res) {
				_this.alertWidth = 'width:' + res.windowWidth + 'px;'
		    }
		});
		this.crm_type = this.rmtype;
		// this.http_lsit(this.user_id,this.rmtype);
		
	},
	methods: {
		// http_lsit(id,type){
		// 	let arrrun = [];
		// 	list({source:'business'}).then((row)=>{
		// 		if(row.code ==200){
		// 			pages({crmType: type,customerIds: id,dtos: row.data,isCollected: false,page: {current: 1, size: 100}}).then((result) => {
		// 					if(result.code == 200){
		// 						if(result.data.records.length > 0){
		// 							for(let i in result.data.records){
		// 								result.data.records[i]['tal'] = row.data
		// 							}
		// 							// this.dataSorce = row.data; // 控制类容
		// 							this.data = result.data.records;	// 控制行
		// 							this.$emit('ruon',this.data)
		// 						}
		// 					}
		// 			})
		// 		}
		// 	})
			
			
		// },
		inbus_dtl(val){
			this.runData = val;
			this.$refs.inbu.open('left')
		},
		close(val){
			if(val == 1){
				this.$refs.inbu.close();
				// location.reload();
				uni.navigateTo({
					url: '/pages/common/index/detial?id=' + this.user_id + '&name=' + this.textname + '&crmType=' + this.rmtype + '&classid=' + this.classid + '&index=' + 3
				})
			}else{
				this.$refs.inbu.close();
			}
		}
	}
}	
	
	
</script>

<style scoped lang="scss">
.in_list {
	width: 100%;
	height: 100%;
	.in_list_class {
		width: 100%;
		margin: auto;
		display: flex;
		.list_left {
			padding: 10rpx 0 10rpx 40rpx;
			width:100%;
			border-bottom: 5px solid #F1F1F1;
			.list_tow {
				padding-left: 30rpx
			}
		}
		.list_left_text{
			padding: 10rpx 0 0 0;
		}
	}
}
	
</style>
